home *** CD-ROM | disk | FTP | other *** search
- ;==========================================================================;
- ; Timer interrupt handler ;
- ; ;
- ; Copyright 1983 by William E. Westfield. All rights reserved. ;
- ; Copyright 1986, 1987 by H. Roy Engehausen. All rights reserved. ;
- ; This software may be freely distributed and used, but it may not ;
- ; under any circumstances be sold by anyone other than the author. ;
- ; It may be distributed by a commercial company as long as it is ;
- ; for no cost. ;
- ; ;
- ; Permission is explicity granted to use this code as a model for ;
- ; other programs requiring interupt driven serial I/O as long as they ;
- ; carry this copyright notice. ;
- ;==========================================================================;
-
- timer_int:
-
- PUSH SI ; Save SI so we can put things in it
- PUSH AX ;
- PUSH BX ;
- PUSH CX ;
- PUSH DX ;
- PUSH DS ;
- PUSH ES ;
-
- MOV AX,CS ; Use DS as needed
- MOV DS,AX ;
- ASSUME DS: everything ; We now have DS working
-
- MOV AL,timer_counter ; Increment timer counter
- CBW ;
- INC AX ;
- MOV timer_counter,AL ;
-
- MOV SI,OFFSET com_start ; Start of COM Blocks
-
- timer_loop:
-
- MOV BL,chip[SI] ; Get chip number
- SHL BL,1 ; *2 for words
- SUB BH,BH ; Need a zero too
- JMP timer_jmp[BX] ; Jump to handler
-
- timer_jmp LABEL WORD
- DW OFFSET timer_next ; Slot not used
- DW OFFSET timer_8250 ; 8250 - IBM ASYNC board
- DW OFFSET timer_8251 ; 8251 - IBM BSC board in ASYNC mode
- DW OFFSET timer_8530 ; 8530 - PACCOMM PC-100 board
- DW OFFSET timer_8250 ; QUADRAM QuadPort
- DW OFFSET timer_8250 ; 4 async port card
-
- timer_8250:
-
- IF present_8250
- INCLUDE 8250TMR.ASM
- ENDIF
-
- JMP timer_next
-
- timer_8251:
- JMP timer_next
-
- timer_8530:
-
- IF present_8530
- INCLUDE 8530TMR.ASM
- ENDIF
-
- ; JMP timer_next ; We can just fall thru
-
- timer_next:
-
- MOV SI,CS:com_next[SI] ; Get next com block
- OR SI,SI ; If still no more blocks then
- JZ timer_exit ; leave
- JMP timer_loop ; Loop back for next
-
- timer_exit: ;
-
- ASSUME DS: NOTHING ; DS now invalid
-
- POP ES ; Restore registers
- POP DS ;
- POP DX ;
- POP CX ;
- POP BX ;
- POP AX ;
- POP SI ;
- JMP CS:DWORD PTR timer_old ; Call old timer interrupt